﻿namespace WinForms.ControlList.Procurement
{
    using Bll.Company;
    using Bll.Procurement;
    using Bll.Supplier;
    using Bll.Systems;
    using Model.Procurement;
    using Model.Systems;
    using System;
    using System.Collections;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;
    using WinForms;
    using WinForms.Properties;

    public class FrmProcurementPaymentAdd : Form
    {
        private Button btn_Close;
        private Button btn_Save;
        private IContainer components = null;
        private ComboBoxNew drp_AccountId;
        private ComboBoxNew drp_supplier;
        public const int HTCAPTION = 2;
        private Label lbl_AccountId;
        private Label lbl_AllMoney;
        private Label lbl_BiTian;
        private LinkLabel lbl_ChongXuan;
        private Label lbl_PayDj;
        private Label lbl_PuDocuNum;
        private Label lbl_Remark;
        private Label lbl_SelectDocument;
        private LinkLabel lbl_SelProc;
        private Label lbl_SupplierId;
        private Label lblTitle;
        public int newPayId = 0;
        private Panel pan_AllPanel;
        private Panel pan_AllPlanes;
        private Panel pan_Bottoms;
        private Panel pan_Dock;
        private Panel pan_DockBottom;
        private Panel pan_DockLeft;
        private Panel pan_DockRight;
        private Panel pan_Lefts;
        private Panel pan_Rights;
        private Panel pan_Table1;
        private Panel pan_Table2;
        private Panel pan_Table3;
        private Panel pan_td0;
        private Panel pan_td1;
        private Panel pan_td10;
        private Panel pan_td11;
        private Panel pan_td2;
        private Panel pan_td3;
        private Panel pan_td4;
        private Panel pan_td5;
        private Panel pan_td8;
        private Panel pan_td9;
        private Panel pan_Top;
        private Panel pan_TopLeft;
        private Panel pan_TopRight;
        private Panel pan_ZhongJian;
        private Panel pane_TopT;
        private Panel panel_BiTian;
        private Panel panel_Button;
        private Panel panel1;
        private Panel panel2;
        private Panel panel3;
        private Panel panel9;
        public FrmPrompt prom = null;
        public const int SC_MOVE = 0xf010;
        private Hashtable SelectList = new Hashtable();
        private TextBox txt_AllMoney;
        private TextBox txt_PuDocuNum;
        private TextBox txt_Remark;
        public const int WM_SYSCOMMAND = 0x112;

        public FrmProcurementPaymentAdd()
        {
            this.InitializeComponent();
            base.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            base.SetStyle(ControlStyles.UserPaint, true);
            base.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.drp_supplier.Select();
            this.SuppLoad();
            this.AccountLoad();
            this.txt_PuDocuNum.Text = IdocumentCodeBll.GetMaxValue("PurchasePayment");
            this.txt_PuDocuNum.ReadOnly = true;
            this.txt_AllMoney.ReadOnly = true;
            this.drp_supplier.Select();
        }

        private void AccountLoad()
        {
            this.drp_AccountId.BeginUpdate();
            UserEnt loginUser = PublicAppliction.LoginUser;
            this.drp_AccountId.Items.Clear();
            this.drp_AccountId.AddItem("---请选择---", "");
            this.drp_AccountId.SelectedIndex = 0;
            DataTable list = CompayAccountBll.GetList("chainNum=" + loginUser.ChainNum);
            foreach (DataRow row in list.Rows)
            {
                this.drp_AccountId.AddItem(row["AccountName"].ToString(), row["AccountId"].ToString());
            }
            this.drp_AccountId.EndUpdate();
        }

        private void btn_Close_Click(object sender, EventArgs e)
        {
            base.DialogResult = DialogResult.Cancel;
            base.Close();
        }

        private void btn_Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.SelectList.Count <= 0)
                {
                    this.prom = new FrmPrompt(false, "请选择要结算单据!");
                    this.prom.ShowDialog();
                    this.lbl_SelProc.Focus();
                }
                else if (this.drp_supplier.SelectValueNew == "")
                {
                    this.prom = new FrmPrompt(false, "请选择供货商!");
                    this.prom.ShowDialog();
                    this.drp_supplier.Focus();
                }
                else if (this.txt_PuDocuNum.Text.Trim() == "")
                {
                    this.prom = new FrmPrompt(false, "请输入付款单据号!");
                    this.prom.ShowDialog();
                    this.txt_PuDocuNum.Focus();
                }
                else if (this.drp_AccountId.SelectValueNew.Trim() == "")
                {
                    this.prom = new FrmPrompt(false, "请选择帐户!");
                    this.prom.ShowDialog();
                    this.drp_AccountId.Focus();
                }
                else
                {
                    ProcurementPaymentEnt model = new ProcurementPaymentEnt();
                    UserEnt loginUser = PublicAppliction.LoginUser;
                    model.ChainNum = loginUser.ChainNum;
                    model.SupplierId = int.Parse(this.drp_supplier.SelectValueNew.Trim());
                    model.PuDocuNum = this.txt_PuDocuNum.Text.Trim();
                    model.AccountId = int.Parse(this.drp_AccountId.SelectValueNew.Trim());
                    model.PurType = 0;
                    model.CreateMan = loginUser.UserId;
                    model.PayTime = DateTime.Now;
                    model.AllMoney = decimal.Parse(this.txt_AllMoney.Text.Trim());
                    model.CreateTime = DateTime.Now;
                    model.CheckTime = DateTime.Now;
                    model.CheckMan = 0;
                    model.IsCheck = 0;
                    model.InvoicingNum = " ";
                    model.IsInvoicing = 0;
                    model.Remark = this.txt_Remark.Text;
                    ProcurementPaymentBll.Add(model);
                    int maxId = ProcurementPaymentBll.GetMaxId("chainNum=" + loginUser.ChainNum);
                    this.newPayId = maxId;
                    foreach (object obj2 in this.SelectList.Values)
                    {
                        ProcurementPaymentListEnt ent3 = new ProcurementPaymentListEnt();
                        ProcurementEnt ent4 = (ProcurementEnt) obj2;
                        ent3.ProcurementId = ent4.ProcurementId;
                        ent3.PurchaseId = maxId;
                        ent3.PayMentMoney = ent4.ToMeetMoney;
                        ProcurementPaymentListBll.Add(ent3);
                    }
                    this.prom = new FrmPrompt(false, "付款信息增加成功!");
                    this.prom.Show();
                    WorkLogBll.AddNewLog("付款信息增加成功", "FrmProcurementPaymentAdd", PublicAppliction.LoginUser);
                    base.DialogResult = DialogResult.OK;
                    base.Close();
                }
            }
            catch (Exception exception)
            {
                ErrorsBll.NewException(exception, PublicAppliction.LoginUser);
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void drp_AccountId_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == '\r')
            {
                this.txt_Remark.Select();
            }
        }

        private void drp_supplier_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == '\r')
            {
                this.lbl_SelProc.Select();
            }
        }

        private void InitializeComponent()
        {
            this.pan_DockLeft = new Panel();
            this.pan_Dock = new Panel();
            this.pan_AllPanel = new Panel();
            this.pan_AllPlanes = new Panel();
            this.panel1 = new Panel();
            this.panel2 = new Panel();
            this.txt_Remark = new TextBox();
            this.panel3 = new Panel();
            this.lbl_Remark = new Label();
            this.pan_Table3 = new Panel();
            this.pan_td11 = new Panel();
            this.pan_td10 = new Panel();
            this.lbl_AccountId = new Label();
            this.pan_td9 = new Panel();
            this.txt_AllMoney = new TextBox();
            this.pan_td8 = new Panel();
            this.lbl_AllMoney = new Label();
            this.pan_Table2 = new Panel();
            this.pan_td5 = new Panel();
            this.lbl_ChongXuan = new LinkLabel();
            this.lbl_SelProc = new LinkLabel();
            this.lbl_SelectDocument = new Label();
            this.pan_td4 = new Panel();
            this.lbl_PayDj = new Label();
            this.pan_Table1 = new Panel();
            this.pan_td3 = new Panel();
            this.pan_td2 = new Panel();
            this.lbl_SupplierId = new Label();
            this.pan_td1 = new Panel();
            this.txt_PuDocuNum = new TextBox();
            this.pan_td0 = new Panel();
            this.lbl_PuDocuNum = new Label();
            this.panel_BiTian = new Panel();
            this.lbl_BiTian = new Label();
            this.panel_Button = new Panel();
            this.btn_Close = new Button();
            this.btn_Save = new Button();
            this.panel9 = new Panel();
            this.pan_Rights = new Panel();
            this.pan_Lefts = new Panel();
            this.pan_Bottoms = new Panel();
            this.pane_TopT = new Panel();
            this.pan_DockBottom = new Panel();
            this.pan_DockRight = new Panel();
            this.pan_Top = new Panel();
            this.pan_ZhongJian = new Panel();
            this.lblTitle = new Label();
            this.pan_TopRight = new Panel();
            this.pan_TopLeft = new Panel();
            this.drp_AccountId = new ComboBoxNew();
            this.drp_supplier = new ComboBoxNew();
            this.pan_Dock.SuspendLayout();
            this.pan_AllPanel.SuspendLayout();
            this.pan_AllPlanes.SuspendLayout();
            this.panel1.SuspendLayout();
            this.panel2.SuspendLayout();
            this.panel3.SuspendLayout();
            this.pan_Table3.SuspendLayout();
            this.pan_td11.SuspendLayout();
            this.pan_td10.SuspendLayout();
            this.pan_td9.SuspendLayout();
            this.pan_td8.SuspendLayout();
            this.pan_Table2.SuspendLayout();
            this.pan_td5.SuspendLayout();
            this.pan_td4.SuspendLayout();
            this.pan_Table1.SuspendLayout();
            this.pan_td3.SuspendLayout();
            this.pan_td2.SuspendLayout();
            this.pan_td1.SuspendLayout();
            this.pan_td0.SuspendLayout();
            this.panel_BiTian.SuspendLayout();
            this.panel_Button.SuspendLayout();
            this.pan_Top.SuspendLayout();
            this.pan_ZhongJian.SuspendLayout();
            base.SuspendLayout();
            this.pan_DockLeft.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockLeft.Dock = DockStyle.Left;
            this.pan_DockLeft.Location = new Point(0, 0);
            this.pan_DockLeft.Name = "pan_DockLeft";
            this.pan_DockLeft.Size = new Size(1, 0xc7);
            this.pan_DockLeft.TabIndex = 0;
            this.pan_Dock.BackColor = Color.FromArgb(0, 0, 15, 0xff);
            this.pan_Dock.Controls.Add(this.pan_AllPanel);
            this.pan_Dock.Controls.Add(this.pan_DockBottom);
            this.pan_Dock.Controls.Add(this.pan_DockRight);
            this.pan_Dock.Controls.Add(this.pan_DockLeft);
            this.pan_Dock.Dock = DockStyle.Fill;
            this.pan_Dock.Location = new Point(0, 0x20);
            this.pan_Dock.Name = "pan_Dock";
            this.pan_Dock.Size = new Size(0x336, 0xc7);
            this.pan_Dock.TabIndex = 5;
            this.pan_AllPanel.BackColor = Color.White;
            this.pan_AllPanel.Controls.Add(this.pan_AllPlanes);
            this.pan_AllPanel.Controls.Add(this.pan_Rights);
            this.pan_AllPanel.Controls.Add(this.pan_Lefts);
            this.pan_AllPanel.Controls.Add(this.pan_Bottoms);
            this.pan_AllPanel.Controls.Add(this.pane_TopT);
            this.pan_AllPanel.Dock = DockStyle.Fill;
            this.pan_AllPanel.Location = new Point(1, 0);
            this.pan_AllPanel.Name = "pan_AllPanel";
            this.pan_AllPanel.Size = new Size(820, 0xc6);
            this.pan_AllPanel.TabIndex = 3;
            this.pan_AllPlanes.Controls.Add(this.panel1);
            this.pan_AllPlanes.Controls.Add(this.pan_Table3);
            this.pan_AllPlanes.Controls.Add(this.pan_Table2);
            this.pan_AllPlanes.Controls.Add(this.pan_Table1);
            this.pan_AllPlanes.Controls.Add(this.panel_BiTian);
            this.pan_AllPlanes.Controls.Add(this.panel_Button);
            this.pan_AllPlanes.Controls.Add(this.panel9);
            this.pan_AllPlanes.Dock = DockStyle.Fill;
            this.pan_AllPlanes.Location = new Point(10, 10);
            this.pan_AllPlanes.Name = "pan_AllPlanes";
            this.pan_AllPlanes.Size = new Size(800, 0xb2);
            this.pan_AllPlanes.TabIndex = 4;
            this.panel1.Controls.Add(this.panel2);
            this.panel1.Controls.Add(this.panel3);
            this.panel1.Dock = DockStyle.Top;
            this.panel1.Location = new Point(0, 100);
            this.panel1.Name = "panel1";
            this.panel1.Size = new Size(800, 0x19);
            this.panel1.TabIndex = 8;
            this.panel2.Controls.Add(this.txt_Remark);
            this.panel2.Dock = DockStyle.Fill;
            this.panel2.Location = new Point(150, 0);
            this.panel2.Name = "panel2";
            this.panel2.Size = new Size(650, 0x19);
            this.panel2.TabIndex = 4;
            this.panel2.Paint += new PaintEventHandler(this.panel2_Paint);
            this.txt_Remark.Location = new Point(5, 2);
            this.txt_Remark.Name = "txt_Remark";
            this.txt_Remark.Size = new Size(630, 0x15);
            this.txt_Remark.TabIndex = 0;
            this.txt_Remark.KeyPress += new KeyPressEventHandler(this.txt_Remark_KeyPress);
            this.panel3.Controls.Add(this.lbl_Remark);
            this.panel3.Dock = DockStyle.Left;
            this.panel3.Location = new Point(0, 0);
            this.panel3.Name = "panel3";
            this.panel3.Size = new Size(150, 0x19);
            this.panel3.TabIndex = 3;
            this.panel3.Paint += new PaintEventHandler(this.panel3_Paint);
            this.lbl_Remark.Location = new Point(60, 5);
            this.lbl_Remark.Name = "lbl_Remark";
            this.lbl_Remark.Size = new Size(0x54, 12);
            this.lbl_Remark.TabIndex = 1;
            this.lbl_Remark.Text = "备注:";
            this.lbl_Remark.TextAlign = ContentAlignment.MiddleRight;
            this.pan_Table3.Controls.Add(this.pan_td11);
            this.pan_Table3.Controls.Add(this.pan_td10);
            this.pan_Table3.Controls.Add(this.pan_td9);
            this.pan_Table3.Controls.Add(this.pan_td8);
            this.pan_Table3.Dock = DockStyle.Top;
            this.pan_Table3.Location = new Point(0, 0x4b);
            this.pan_Table3.Name = "pan_Table3";
            this.pan_Table3.Size = new Size(800, 0x19);
            this.pan_Table3.TabIndex = 3;
            this.pan_td11.Controls.Add(this.drp_AccountId);
            this.pan_td11.Dock = DockStyle.Left;
            this.pan_td11.Location = new Point(550, 0);
            this.pan_td11.Name = "pan_td11";
            this.pan_td11.Size = new Size(250, 0x19);
            this.pan_td11.TabIndex = 0;
            this.pan_td11.Paint += new PaintEventHandler(this.pan_td11_Paint);
            this.pan_td10.Controls.Add(this.lbl_AccountId);
            this.pan_td10.Dock = DockStyle.Left;
            this.pan_td10.Location = new Point(400, 0);
            this.pan_td10.Name = "pan_td10";
            this.pan_td10.Size = new Size(150, 0x19);
            this.pan_td10.TabIndex = 1;
            this.pan_td10.Paint += new PaintEventHandler(this.pan_td10_Paint);
            this.lbl_AccountId.Location = new Point(60, 7);
            this.lbl_AccountId.Name = "lbl_AccountId";
            this.lbl_AccountId.Size = new Size(0x54, 12);
            this.lbl_AccountId.TabIndex = 0;
            this.lbl_AccountId.Text = "付款帐户:";
            this.lbl_AccountId.TextAlign = ContentAlignment.MiddleRight;
            this.pan_td9.Controls.Add(this.txt_AllMoney);
            this.pan_td9.Dock = DockStyle.Left;
            this.pan_td9.Location = new Point(150, 0);
            this.pan_td9.Name = "pan_td9";
            this.pan_td9.Size = new Size(250, 0x19);
            this.pan_td9.TabIndex = 2;
            this.pan_td9.Paint += new PaintEventHandler(this.pan_td9_Paint);
            this.txt_AllMoney.Location = new Point(5, 2);
            this.txt_AllMoney.MaxLength = 20;
            this.txt_AllMoney.Name = "txt_AllMoney";
            this.txt_AllMoney.Size = new Size(230, 0x15);
            this.txt_AllMoney.TabIndex = 8;
            this.txt_AllMoney.KeyPress += new KeyPressEventHandler(this.txt_AllMoney_KeyPress);
            this.pan_td8.Controls.Add(this.lbl_AllMoney);
            this.pan_td8.Dock = DockStyle.Left;
            this.pan_td8.Location = new Point(0, 0);
            this.pan_td8.Name = "pan_td8";
            this.pan_td8.Size = new Size(150, 0x19);
            this.pan_td8.TabIndex = 3;
            this.pan_td8.Paint += new PaintEventHandler(this.pan_td8_Paint);
            this.lbl_AllMoney.Location = new Point(60, 7);
            this.lbl_AllMoney.Name = "lbl_AllMoney";
            this.lbl_AllMoney.Size = new Size(0x54, 12);
            this.lbl_AllMoney.TabIndex = 0;
            this.lbl_AllMoney.Text = "付款总金额:";
            this.lbl_AllMoney.TextAlign = ContentAlignment.MiddleRight;
            this.pan_Table2.Controls.Add(this.pan_td5);
            this.pan_Table2.Controls.Add(this.pan_td4);
            this.pan_Table2.Dock = DockStyle.Top;
            this.pan_Table2.Location = new Point(0, 50);
            this.pan_Table2.Name = "pan_Table2";
            this.pan_Table2.Size = new Size(800, 0x19);
            this.pan_Table2.TabIndex = 4;
            this.pan_td5.Controls.Add(this.lbl_ChongXuan);
            this.pan_td5.Controls.Add(this.lbl_SelProc);
            this.pan_td5.Controls.Add(this.lbl_SelectDocument);
            this.pan_td5.Dock = DockStyle.Fill;
            this.pan_td5.Location = new Point(150, 0);
            this.pan_td5.Name = "pan_td5";
            this.pan_td5.Size = new Size(650, 0x19);
            this.pan_td5.TabIndex = 2;
            this.pan_td5.Paint += new PaintEventHandler(this.pan_td5_Paint);
            this.lbl_ChongXuan.AutoSize = true;
            this.lbl_ChongXuan.Location = new Point(0x62, 6);
            this.lbl_ChongXuan.Name = "lbl_ChongXuan";
            this.lbl_ChongXuan.Size = new Size(0x1d, 12);
            this.lbl_ChongXuan.TabIndex = 2;
            this.lbl_ChongXuan.TabStop = true;
            this.lbl_ChongXuan.Text = "重选";
            this.lbl_ChongXuan.LinkClicked += new LinkLabelLinkClickedEventHandler(this.lbl_ChongXuan_LinkClicked);
            this.lbl_SelProc.AutoSize = true;
            this.lbl_SelProc.Location = new Point(3, 6);
            this.lbl_SelProc.Name = "lbl_SelProc";
            this.lbl_SelProc.Size = new Size(0x59, 12);
            this.lbl_SelProc.TabIndex = 1;
            this.lbl_SelProc.TabStop = true;
            this.lbl_SelProc.Text = "选择付款采购单";
            this.lbl_SelProc.LinkClicked += new LinkLabelLinkClickedEventHandler(this.lbl_SelProc_LinkClicked);
            this.lbl_SelectDocument.AutoSize = true;
            this.lbl_SelectDocument.Location = new Point(0x87, 6);
            this.lbl_SelectDocument.Name = "lbl_SelectDocument";
            this.lbl_SelectDocument.Size = new Size(0, 12);
            this.lbl_SelectDocument.TabIndex = 0;
            this.pan_td4.Controls.Add(this.lbl_PayDj);
            this.pan_td4.Dock = DockStyle.Left;
            this.pan_td4.Location = new Point(0, 0);
            this.pan_td4.Name = "pan_td4";
            this.pan_td4.Size = new Size(150, 0x19);
            this.pan_td4.TabIndex = 3;
            this.pan_td4.Paint += new PaintEventHandler(this.pan_td4_Paint);
            this.lbl_PayDj.AutoSize = true;
            this.lbl_PayDj.Location = new Point(0x55, 5);
            this.lbl_PayDj.Name = "lbl_PayDj";
            this.lbl_PayDj.Size = new Size(0x3b, 12);
            this.lbl_PayDj.TabIndex = 0;
            this.lbl_PayDj.Text = "付款单据:";
            this.pan_Table1.Controls.Add(this.pan_td3);
            this.pan_Table1.Controls.Add(this.pan_td2);
            this.pan_Table1.Controls.Add(this.pan_td1);
            this.pan_Table1.Controls.Add(this.pan_td0);
            this.pan_Table1.Dock = DockStyle.Top;
            this.pan_Table1.Location = new Point(0, 0x19);
            this.pan_Table1.Name = "pan_Table1";
            this.pan_Table1.Size = new Size(800, 0x19);
            this.pan_Table1.TabIndex = 5;
            this.pan_td3.Controls.Add(this.drp_supplier);
            this.pan_td3.Dock = DockStyle.Left;
            this.pan_td3.Location = new Point(550, 0);
            this.pan_td3.Name = "pan_td3";
            this.pan_td3.Size = new Size(250, 0x19);
            this.pan_td3.TabIndex = 0;
            this.pan_td3.Paint += new PaintEventHandler(this.pan_td3_Paint);
            this.pan_td2.Controls.Add(this.lbl_SupplierId);
            this.pan_td2.Dock = DockStyle.Left;
            this.pan_td2.Location = new Point(400, 0);
            this.pan_td2.Name = "pan_td2";
            this.pan_td2.Size = new Size(150, 0x19);
            this.pan_td2.TabIndex = 1;
            this.pan_td2.Paint += new PaintEventHandler(this.pan_td2_Paint);
            this.lbl_SupplierId.Location = new Point(60, 5);
            this.lbl_SupplierId.Name = "lbl_SupplierId";
            this.lbl_SupplierId.Size = new Size(0x54, 12);
            this.lbl_SupplierId.TabIndex = 0;
            this.lbl_SupplierId.Text = "供货商:";
            this.lbl_SupplierId.TextAlign = ContentAlignment.MiddleRight;
            this.pan_td1.Controls.Add(this.txt_PuDocuNum);
            this.pan_td1.Dock = DockStyle.Left;
            this.pan_td1.Location = new Point(150, 0);
            this.pan_td1.Name = "pan_td1";
            this.pan_td1.Size = new Size(250, 0x19);
            this.pan_td1.TabIndex = 2;
            this.pan_td1.Paint += new PaintEventHandler(this.pan_td1_Paint);
            this.txt_PuDocuNum.Location = new Point(5, 2);
            this.txt_PuDocuNum.MaxLength = 20;
            this.txt_PuDocuNum.Name = "txt_PuDocuNum";
            this.txt_PuDocuNum.Size = new Size(230, 0x15);
            this.txt_PuDocuNum.TabIndex = 1;
            this.pan_td0.Controls.Add(this.lbl_PuDocuNum);
            this.pan_td0.Dock = DockStyle.Left;
            this.pan_td0.Location = new Point(0, 0);
            this.pan_td0.Name = "pan_td0";
            this.pan_td0.Size = new Size(150, 0x19);
            this.pan_td0.TabIndex = 3;
            this.pan_td0.Paint += new PaintEventHandler(this.pan_td0_Paint);
            this.lbl_PuDocuNum.Location = new Point(0x3e, 5);
            this.lbl_PuDocuNum.Name = "lbl_PuDocuNum";
            this.lbl_PuDocuNum.Size = new Size(0x54, 12);
            this.lbl_PuDocuNum.TabIndex = 0;
            this.lbl_PuDocuNum.Text = "付款单据号:";
            this.lbl_PuDocuNum.TextAlign = ContentAlignment.MiddleRight;
            this.panel_BiTian.Controls.Add(this.lbl_BiTian);
            this.panel_BiTian.Dock = DockStyle.Top;
            this.panel_BiTian.Location = new Point(0, 0);
            this.panel_BiTian.Name = "panel_BiTian";
            this.panel_BiTian.Size = new Size(800, 0x19);
            this.panel_BiTian.TabIndex = 6;
            this.panel_BiTian.Paint += new PaintEventHandler(this.panel_BiTian_Paint);
            this.lbl_BiTian.AutoSize = true;
            this.lbl_BiTian.Location = new Point(10, 6);
            this.lbl_BiTian.Name = "lbl_BiTian";
            this.lbl_BiTian.Size = new Size(0x35, 12);
            this.lbl_BiTian.TabIndex = 0;
            this.lbl_BiTian.Text = "必填项目";
            this.panel_Button.Controls.Add(this.btn_Close);
            this.panel_Button.Controls.Add(this.btn_Save);
            this.panel_Button.Dock = DockStyle.Bottom;
            this.panel_Button.Location = new Point(0, 130);
            this.panel_Button.Name = "panel_Button";
            this.panel_Button.Size = new Size(800, 0x2b);
            this.panel_Button.TabIndex = 7;
            this.panel_Button.Paint += new PaintEventHandler(this.panel_Button_Paint);
            this.btn_Close.Location = new Point(0x1ad, 10);
            this.btn_Close.Name = "btn_Close";
            this.btn_Close.Size = new Size(0x4b, 0x17);
            this.btn_Close.TabIndex = 13;
            this.btn_Close.Text = "关 闭";
            this.btn_Close.UseVisualStyleBackColor = true;
            this.btn_Close.Click += new EventHandler(this.btn_Close_Click);
            this.btn_Save.Location = new Point(0x128, 10);
            this.btn_Save.Name = "btn_Save";
            this.btn_Save.Size = new Size(0x4b, 0x17);
            this.btn_Save.TabIndex = 12;
            this.btn_Save.Text = "保 存";
            this.btn_Save.UseVisualStyleBackColor = true;
            this.btn_Save.Click += new EventHandler(this.btn_Save_Click);
            this.panel9.Dock = DockStyle.Bottom;
            this.panel9.Location = new Point(0, 0xad);
            this.panel9.Name = "panel9";
            this.panel9.Size = new Size(800, 5);
            this.panel9.TabIndex = 3;
            this.pan_Rights.Dock = DockStyle.Right;
            this.pan_Rights.Location = new Point(810, 10);
            this.pan_Rights.Name = "pan_Rights";
            this.pan_Rights.Size = new Size(10, 0xb2);
            this.pan_Rights.TabIndex = 3;
            this.pan_Lefts.Dock = DockStyle.Left;
            this.pan_Lefts.Location = new Point(0, 10);
            this.pan_Lefts.Name = "pan_Lefts";
            this.pan_Lefts.Size = new Size(10, 0xb2);
            this.pan_Lefts.TabIndex = 2;
            this.pan_Bottoms.Dock = DockStyle.Bottom;
            this.pan_Bottoms.Location = new Point(0, 0xbc);
            this.pan_Bottoms.Name = "pan_Bottoms";
            this.pan_Bottoms.Size = new Size(820, 10);
            this.pan_Bottoms.TabIndex = 1;
            this.pane_TopT.Dock = DockStyle.Top;
            this.pane_TopT.Location = new Point(0, 0);
            this.pane_TopT.Name = "pane_TopT";
            this.pane_TopT.Size = new Size(820, 10);
            this.pane_TopT.TabIndex = 0;
            this.pan_DockBottom.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockBottom.Dock = DockStyle.Bottom;
            this.pan_DockBottom.Location = new Point(1, 0xc6);
            this.pan_DockBottom.Name = "pan_DockBottom";
            this.pan_DockBottom.Size = new Size(820, 1);
            this.pan_DockBottom.TabIndex = 2;
            this.pan_DockRight.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockRight.Dock = DockStyle.Right;
            this.pan_DockRight.Location = new Point(0x335, 0);
            this.pan_DockRight.Name = "pan_DockRight";
            this.pan_DockRight.Size = new Size(1, 0xc7);
            this.pan_DockRight.TabIndex = 1;
            this.pan_Top.Controls.Add(this.pan_ZhongJian);
            this.pan_Top.Controls.Add(this.pan_TopRight);
            this.pan_Top.Controls.Add(this.pan_TopLeft);
            this.pan_Top.Dock = DockStyle.Top;
            this.pan_Top.Location = new Point(0, 0);
            this.pan_Top.Name = "pan_Top";
            this.pan_Top.Size = new Size(0x336, 0x20);
            this.pan_Top.TabIndex = 4;
            this.pan_ZhongJian.BackgroundImage = Resources.uc_title_2;
            this.pan_ZhongJian.Controls.Add(this.lblTitle);
            this.pan_ZhongJian.Dock = DockStyle.Fill;
            this.pan_ZhongJian.Location = new Point(0x1f, 0);
            this.pan_ZhongJian.Name = "pan_ZhongJian";
            this.pan_ZhongJian.Size = new Size(0x312, 0x20);
            this.pan_ZhongJian.TabIndex = 2;
            this.pan_ZhongJian.MouseDown += new MouseEventHandler(this.pan_ZhongJian_MouseDown);
            this.lblTitle.AutoSize = true;
            this.lblTitle.BackColor = Color.FromArgb(0, 0, 15, 0xff);
            this.lblTitle.Font = new Font("宋体", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0x86);
            this.lblTitle.ForeColor = Color.FromArgb(0x3b, 0x56, 20);
            this.lblTitle.Location = new Point(6, 8);
            this.lblTitle.Name = "lblTitle";
            this.lblTitle.Size = new Size(0x5b, 13);
            this.lblTitle.TabIndex = 0;
            this.lblTitle.Text = "新增采购付款";
            this.pan_TopRight.BackgroundImage = Resources.uc_title_1;
            this.pan_TopRight.Dock = DockStyle.Right;
            this.pan_TopRight.Location = new Point(0x331, 0);
            this.pan_TopRight.Name = "pan_TopRight";
            this.pan_TopRight.Size = new Size(5, 0x20);
            this.pan_TopRight.TabIndex = 1;
            this.pan_TopLeft.BackgroundImage = Resources.uc_title;
            this.pan_TopLeft.Dock = DockStyle.Left;
            this.pan_TopLeft.Location = new Point(0, 0);
            this.pan_TopLeft.Name = "pan_TopLeft";
            this.pan_TopLeft.Size = new Size(0x1f, 0x20);
            this.pan_TopLeft.TabIndex = 0;
            this.pan_TopLeft.MouseDown += new MouseEventHandler(this.pan_TopLeft_MouseDown);
            this.drp_AccountId.DisplayMember = "Name";
            this.drp_AccountId.DropDownStyle = ComboBoxStyle.DropDownList;
            this.drp_AccountId.FormattingEnabled = true;
            this.drp_AccountId.Location = new Point(5, 3);
            this.drp_AccountId.Name = "drp_AccountId";
            this.drp_AccountId.SelectValueNew = "";
            this.drp_AccountId.Size = new Size(230, 20);
            this.drp_AccountId.TabIndex = 0;
            this.drp_AccountId.ValueMember = "Value";
            this.drp_AccountId.KeyPress += new KeyPressEventHandler(this.drp_AccountId_KeyPress);
            this.drp_supplier.DisplayMember = "Name";
            this.drp_supplier.DropDownStyle = ComboBoxStyle.DropDownList;
            this.drp_supplier.FormattingEnabled = true;
            this.drp_supplier.Location = new Point(5, 2);
            this.drp_supplier.Name = "drp_supplier";
            this.drp_supplier.SelectValueNew = "";
            this.drp_supplier.Size = new Size(230, 20);
            this.drp_supplier.TabIndex = 1;
            this.drp_supplier.ValueMember = "Value";
            this.drp_supplier.KeyPress += new KeyPressEventHandler(this.drp_supplier_KeyPress);
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x336, 0xe7);
            base.Controls.Add(this.pan_Dock);
            base.Controls.Add(this.pan_Top);
            base.FormBorderStyle = FormBorderStyle.None;
            base.MaximizeBox = false;
            base.MinimizeBox = false;
            base.Name = "FrmProcurementPaymentAdd";
            base.ShowIcon = false;
            base.ShowInTaskbar = false;
            this.pan_Dock.ResumeLayout(false);
            this.pan_AllPanel.ResumeLayout(false);
            this.pan_AllPlanes.ResumeLayout(false);
            this.panel1.ResumeLayout(false);
            this.panel2.ResumeLayout(false);
            this.panel2.PerformLayout();
            this.panel3.ResumeLayout(false);
            this.pan_Table3.ResumeLayout(false);
            this.pan_td11.ResumeLayout(false);
            this.pan_td10.ResumeLayout(false);
            this.pan_td9.ResumeLayout(false);
            this.pan_td9.PerformLayout();
            this.pan_td8.ResumeLayout(false);
            this.pan_Table2.ResumeLayout(false);
            this.pan_td5.ResumeLayout(false);
            this.pan_td5.PerformLayout();
            this.pan_td4.ResumeLayout(false);
            this.pan_td4.PerformLayout();
            this.pan_Table1.ResumeLayout(false);
            this.pan_td3.ResumeLayout(false);
            this.pan_td2.ResumeLayout(false);
            this.pan_td1.ResumeLayout(false);
            this.pan_td1.PerformLayout();
            this.pan_td0.ResumeLayout(false);
            this.panel_BiTian.ResumeLayout(false);
            this.panel_BiTian.PerformLayout();
            this.panel_Button.ResumeLayout(false);
            this.pan_Top.ResumeLayout(false);
            this.pan_ZhongJian.ResumeLayout(false);
            this.pan_ZhongJian.PerformLayout();
            base.ResumeLayout(false);
        }

        private void lbl_ChongXuan_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            this.SelectList.Clear();
            this.lbl_SelectDocument.Text = "";
        }

        private void lbl_SelProc_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (this.drp_supplier.SelectValueNew == "")
            {
                MessageBox.Show("请先选择要结算的供应商!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                this.drp_supplier.Focus();
            }
            else
            {
                FrmProcurementSelect select = new FrmProcurementSelect(this.drp_supplier.SelectValueNew);
                decimal num = 0M;
                if (select.ShowDialog() == DialogResult.OK)
                {
                    this.SelectList.Clear();
                    foreach (object obj2 in select.SelectList)
                    {
                        ProcurementEnt ent = (ProcurementEnt) obj2;
                        if (!this.SelectList.ContainsKey(ent.ProcurementId))
                        {
                            this.SelectList.Add(ent.ProcurementId, ent.Clone());
                            object text = this.lbl_SelectDocument.Text;
                            this.lbl_SelectDocument.Text = string.Concat(new object[] { text, ent.IDDocuments, " ", ent.ToMeetMoney, "," });
                            num += ent.ToMeetMoney;
                        }
                    }
                    this.txt_AllMoney.Text = num.ToString();
                    if (this.lbl_SelectDocument.Text != "")
                    {
                        this.lbl_SelectDocument.Text = this.lbl_SelectDocument.Text.Substring(0, this.lbl_SelectDocument.Text.Length - 1);
                    }
                    this.drp_AccountId.Select();
                }
                select.Close();
            }
        }

        private void pan_td0_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td0, Color.FromArgb(0xca, 0xc9, 0xce), 1, 0, 1, 1);
        }

        private void pan_td1_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td1, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td10_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td10, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td11_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td11, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td2_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td2, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td3_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td3, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td4_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td4, Color.FromArgb(0xca, 0xc9, 0xce), 1, 0, 1, 1);
        }

        private void pan_td5_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td5, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td8_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td8, Color.FromArgb(0xca, 0xc9, 0xce), 1, 0, 1, 1);
        }

        private void pan_td9_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td9, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_TopLeft_MouseDown(object sender, MouseEventArgs e)
        {
            ReleaseCapture();
            SendMessage(base.Handle, 0x112, 0xf012, 0);
        }

        private void pan_ZhongJian_MouseDown(object sender, MouseEventArgs e)
        {
            ReleaseCapture();
            SendMessage(base.Handle, 0x112, 0xf012, 0);
        }

        private void panel_BiTian_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel_BiTian, Color.FromArgb(0xca, 0xc9, 0xce), 1, 1, 1, 1);
        }

        private void panel_Button_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel_Button, Color.FromArgb(0xca, 0xc9, 0xce), 1, 1, 1, 1);
        }

        private void Panel_ResetPaint(PaintEventArgs e, Panel panel, Color color, int leftBoder, int topBoder, int rightBoder, int bottomBoder)
        {
            ControlPaint.DrawBorder(e.Graphics, panel.ClientRectangle, color, leftBoder, ButtonBorderStyle.Solid, color, topBoder, ButtonBorderStyle.Solid, color, rightBoder, ButtonBorderStyle.Solid, color, bottomBoder, ButtonBorderStyle.Solid);
        }

        private void panel2_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel2, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void panel3_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel3, Color.FromArgb(0xca, 0xc9, 0xce), 1, 0, 1, 1);
        }

        [DllImport("user32.dll")]
        public static extern bool ReleaseCapture();
        [DllImport("user32.dll")]
        public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
        private void SuppLoad()
        {
            UserEnt loginUser = PublicAppliction.LoginUser;
            DataTable list = SupplierBll.GetList("chainnum=" + loginUser.ChainNum);
            this.drp_supplier.BeginUpdate();
            this.drp_supplier.Items.Clear();
            this.drp_supplier.AddItem("---请选择---", "");
            this.drp_supplier.SelectedIndex = 0;
            foreach (DataRow row in list.Rows)
            {
                this.drp_supplier.AddItem(row["SupplierName"].ToString(), row["SupplierId"].ToString());
            }
            this.drp_supplier.EndUpdate();
        }

        private void txt_AllMoney_KeyPress(object sender, KeyPressEventArgs e)
        {
            if ((((e.KeyChar < '0') || (e.KeyChar > '9')) && (e.KeyChar != '\b')) && (e.KeyChar != '.'))
            {
                e.Handled = true;
            }
        }

        private void txt_Remark_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == '\r')
            {
                this.btn_Save.Select();
            }
        }
    }
}

